<template>
  <div>
    <van-nav-bar title="" left-text="返回"  left-arrow  @click-left="onClickLeft"
                 @click-right="onClickRight" />
    <div id="header" style="width: 100%;height:auto ; border: 1px solid silver;border-radius: 20px;">
      <div id="title">
        <h3>{{this.articleInfo.articleTitle}}</h3>
      </div>
      <div id="body" style=" padding: 20px;">
      <span style="line-height: 30px;">
        <iframe :src="articleInfo.articleUrl" width="100%" height="600px" scrolling="yes" />
      </span>
      </div>
      <div style="float: right">
        <span>来源:{{this.articleInfo.articleWriter}}</span>

      </div>
    </div>

  </div>
</template>

<script>
import axios from "axios";

export default {
  name: "articleinfo",
  data(){
    return{
      id: '',
      articleInfo: {}
    }
  },
  methods:{
    findArtcileById() {
      axios.post('http://localhost:7000/article/findArticleById/' + this.id).then(res => {
        this.articleInfo = res.data.data;

      });
    },
    onClickLeft() {
      this.$router.go(-1)
    },
  },
  mounted() {
    this.id = this.$route.params.id;
    this.findArtcileById();
  }
}
</script>

<style scoped>

</style>
